<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
   <script>
        // 内置对象
        // Date 
        var now = new Date();
        // var month = now.getMonth()// 获取的月份比当前月 小1
        // console.log(month)
        var h = now.getHours()
        var m = now.getMinutes()
        var s = now.getSeconds()
        document.write(h+':'+m+':'+s)

        setInterval(function(){
            var now = new Date();
            var h = now.getHours()
            var m = now.getMinutes()
            var s = now.getSeconds()
            console.log(h+':'+m+':'+s)
        },1000)
        // Math 
        // Math.random() 返回一个0-1的随机数，包含0，不包含1
        // console.log(Math.random())
        // console.log(Math.max(1,3))
        // console.log(Math.round(4.55))//四舍五入
        // console.log(Math.ceil(4.1))//向上取整
        // console.log(Math.floor(4.9))//向下取整
        
        // 0-100的随机整数(包含0和100)
        // console.log(Math.floor(Math.random()*101)) 
        // 随机点名
        // var nameList = ['李蒙','李奕飞','浩博','婧楠','童俊燃','徐敬磊'];
        // var index = Math.floor(Math.random()*6)
        // document.write(nameList[index])

        // var nameList = [{name:'李蒙',avator:''},{}];
        // var index = Math.floor(Math.random()*6)
        // document.write(nameList[index].name)
        // document.write( '<img src='+nameList[index].avator+'>')

        // var str = 'abc';
        // console.log(str.length)
        // console.log(str.slice(0,2))

        // var str = 'abc';
        // var str2 = new String('def');
        // console.log(str)
        // console.log(str2)
        // console.log(typeof str)
        // console.log(typeof str2)
        // console.log( str2.slice(0,2) )

   </script>
</body>
</html>